package com.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.project.bean.OrderBean;
import com.project.mapper.IOrderMapper;
import com.project.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class OrderServiceImpl implements IOrderService {
    @Autowired
    private IOrderMapper orderMapper;
    @Override
    public void addOrder(OrderBean orderBean) {
        orderMapper.insert(orderBean);
    }

    @Override
    public List<OrderBean> getOrderAll(String userName) {
        QueryWrapper<OrderBean> qw=new QueryWrapper<>();
        qw.eq("u_userName",userName);
        return orderMapper.selectList(qw);
    }
}
